﻿using System;
using System.Collections.Generic;

namespace RexToy.Cassandra
{
    class CounterRow<K, C> : ICounterRow<K, C>
    {
        internal CounterRow(K key, ICounterColumnCollection<C> collection)
        {
            key.ThrowIfNullArgument("key");
            collection.ThrowIfNullArgument("collection");

            _key = key;
            _collection = collection;
        }

        private ICounterColumnCollection<C> _collection;
        public ICounterColumnCollection<C> Columns
        {
            get { return _collection; }
        }

        public ICounterColumn<C> this[C name]
        {
            get { return _collection[name]; }
        }

        private K _key;
        public K Key
        {
            get { return _key; }
        }

        IColumnCollection<C> IRow<K, C>.Columns
        {
            get { return _collection; }
        }

        IColumn<C> IRow<K, C>.this[C name]
        {
            get { return _collection[name]; }
        }
    }
}
